package com.personal.kousuan.random;

import java.util.Random;

import com.personal.kousuan.util.RandomUtil;


public class BuJieWeiRandomGenerator implements RandomGenerator {

	/**
	 * 创建一个随机数，使其比Seed小
	 */
	@Override
	public int generateRandom(int seed) {
		return RandomUtil.generateRandom(0, seed);
	}
	
	/**
	 * 创建一个随机数，使其比Seed小，但要小于max
	 */
	@Override
	public int generateRandom(int seed, int max) {
/*		//取得Seed的个位
		int seedGeWei = seed % 10;
		
		int gewei = RandomUtil.generateRandom(0,seedGeWei);
				
		int shiweiBase = seed / 10;
		
		int shiwei = RandomUtil.generateRandom(0, shiweiBase);
		
		return shiwei * 10 + gewei;
*/
	
		return RandomUtil.generateRandom(1, seed > max?max:seed);
		
	}


}
